package ru.myrtle.umf.query.condition;

import ru.myrtle.umf.query.UCondition;

/**
 * A <code>Condition</code> that negates the result of evaluation of another
 * <code>Condition</code>
 */
public class UNot extends UCondition {

    private UCondition condition;

    /**
     * Constructor of this negating <code>Condition</code>
     *
     * @param condition
     *            The <code>Condition</code> whose evaluation result is
     *            negated
     */
    public UNot(UCondition condition) {
        this.condition = condition;
    }

    @Override
    public boolean isSatisfied(Object object) {
        return !(condition.isSatisfied(object));
    }
}